package com.jt.assistant.adapter

import android.annotation.SuppressLint
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import coil.load
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.jt.assistant.R
import com.jt.assistant.base.BaseApplication
import com.jt.assistant.bean.CarReceiveBean

class CarReceiveAdapter(mData: MutableList<CarReceiveBean>) :
    BaseQuickAdapter<CarReceiveBean, BaseViewHolder>(
        R.layout.item_car_receive, mData
    ) {

    init {
        addChildClickViewIds(R.id.bt_detail)
    }

    @SuppressLint("SetTextI18n")
    override fun convert(holder: BaseViewHolder, item: CarReceiveBean) {
        val text = holder.getView<TextView>(R.id.tv_text)
        text.text = item.licence + "        " +
                item.desCityName.substring(0, 2) + "\n" +
                item.dispatchCarDate + "      " +
                (if (item.type == 0) "送仓" else "退仓")

//        if (item.isEmpty())
//            Glide.with(BaseApplication.getContext())
//                .load(R.mipmap.ic_add_pic)
//                .into(ivPic)
//        else
//            Glide.with(BaseApplication.getContext())
//                .load(item)
//                .into(ivPic)
    }


}